package com.winning.devops.batch.listener.job;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionListener;

/**
 * Job 执行监听器
 *
 * @author chensj
 * @date 2020-02-29 15:08
 */
public class FirstJobExecutionListener implements JobExecutionListener {

    /**
     * logger
     */
    private static final Logger logger = LoggerFactory.getLogger(FirstJobExecutionListener.class);

    @Override
    public void beforeJob(JobExecution jobExecution) {
        logger.info("{} listener beforeJob", jobExecution.getJobInstance().getJobName());
    }

    @Override
    public void afterJob(JobExecution jobExecution) {
        logger.info("{} listener afterJob", jobExecution.getJobInstance().getJobName());

    }
}
